<h1><?php echo $title; ?></h1>

<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>

<form name="form1" method="post" action="<?php echo site_url('adozioni/anagrafica/assistiti/save') ?>">
  <h2>Dati personali</h2> <br>
  <table width="80%" border="0" cellpadding="1" cellspacing="1" class="form">
    <tr>
      <th class="celeste bold"><strong>Tipo</strong></th>
      <td class="item1"><?php echo $this->ass->select_tipoassistito($row['id_tipo']); ?></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Cognome e Nome </strong></th>
      <td class="item1"><input name="nomecognome" type="text" id="nomecognome" value="<?php echo $row['nomecognome']; ?>" size="80"></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Info</strong></th>
      <td class="item1"><input name="info" type="text" id="info" value="<?php echo $row['info']; ?>" size="80"></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Sesso</strong></th>
      <td class="item1"><?php echo $this->ass->select_sesso($row['sesso']); ?></td>
    </tr>
    <tr>
      <th width="30%" class="celeste bold"><strong>Data di Nascita </strong></th>
      <td class="item1">
      <?php echo $this->ass->select_data_nascita($row['data_nascita'], 'nascita'); ?></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Luogo di Nascita </strong></th>
      <td class="item1"><input name="luogo_nascita" type="text" id="luogo_nascita" value="<?php echo $row['luogo_nascita']; ?>" size="80"></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Nazione di Nascita </strong></th>
      <td class="item1"><input name="nazione" type="text" id="nazione" value="<?php echo $row['nazione']; ?>" size="80"></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Stato</strong></th>
      <td class="item1"><input name="stato" type="text" id="stato" value="<?php echo $row['stato']; ?>" size="80"></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Missione</strong></th>
      <td class="item1">
      <select name="id_missione"><option></option>
      <?php foreach($missioni as $m): ?>
      <option value="<?php echo $m['id']?>" <?php if($m['id'] == $row['id_missione']) echo "selected"; ?>><?php echo $m['nome']; ?></option>
      
      <?php endforeach; ?>
      </select>
      </td>
    </tr>
  </table>
  <br>
  <h2>Parentela</h2><br>
  <table width="80%" border="0" cellpadding="1" cellspacing="1" class="form">
    <tr>
      <th class="celeste bold"><strong>Padre</strong></th>
      <td class="item1"><input name="padre" type="text" id="nome24" value="<?php echo $row['padre']; ?>" size="80"></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Madre</strong></th>
      <td class="item1"><input name="madre" type="text" id="madre" value="<?php echo $row['madre']; ?>" size="80"></td>
    </tr>
    <tr>
      <th class="celeste bold"><strong>Responsabile</strong></th>
      <td class="item1"><input name="responsabile" type="text" id="nome25" value="<?php echo $row['responsabile']; ?>" size="80"></td>
    </tr>
    <tr> 
      <th width="30%" class="celeste bold"><strong>Parentela</strong></th>
      <td class="item1">
        <input name="parentela" type="text" id="parentela" value="<?php echo $row['parentela']; ?>" size="80"></td>
    </tr>
  </table>
  <br>
  <br>
  <h2>Note</h2>
  <table width="80%" border="0" cellpadding="1" cellspacing="1" class="form">
    <tr>
      <th width="30%" class="celeste bold"><strong>Note</strong></th>
      <td class="item1"><textarea name="note" cols="75" rows="10" id="note" ><?php echo $row['note']; ?></textarea></td>
    </tr>
    <tr>
      <th class="celeste bold">Note Riservate </td>
      <td class="item1"><textarea name="note_riservate" cols="75" rows="10" id="note_riservate"><?php echo $row['note_riservate']; ?></textarea></td>
    </tr>
  </table>
  <br>
  <br>
  <table width="80%"  border="0">
    <tr>
      <td align="center"><input name="op" type="hidden" id="op" value="update">
        <input name="id" type="hidden" id="id" value="<?php echo $row['id']; ?>"><input name="attivo" type="hidden" id="attivo" value="1">
     		<input type="submit" name="Submit" value="Salva Modifiche" style="cursor:hand">
				&nbsp;&nbsp;&nbsp;
				<input type="button" name="Submit2" value="Annulla" onclick="document.location = '<?php echo site_url('adozioni/anagrafica/assistiti')?>';" style="cursor:hand">
	  </td>
	</tr>
  </table>
</form>
<script>
 document.form1.id_tipo.focus();
</script>
